# -*- coding:utf-8 -*-
import time
import datetime
import calendar


def timestamp():
    f = '%Y/%m/%d %H:%M:%S'
    value = time.localtime(int(time.time()))
    dt = time.strftime(f, value)
    return dt


def dealine(days):
    """
    计算从调用此函数开始 days天后的日期
    :param days: type: int
    """
    d = datetime.datetime.utcnow() + datetime.timedelta(days=int(days))
    time_stamp = calendar.timegm(d.utctimetuple())
    f = '%Y/%m/%d %H:%M:%S'
    # f = '%Y/%m/%d'
    value = time.localtime(time_stamp)
    dt = time.strftime(f, value)
    return dt
